function getDateInfo(timeStamp) {
	const date = new Date(timeStamp);

	const year = date.getFullYear();
	const month = date.getMonth() + 1;
	const day = date.getDate();
	const hour = date.getHours();
	const minute = date.getMinutes();
	const second = date.getSeconds();

	console.log({
		year,
		month,
		day,
		hour,
		minute,
		second,
		yearStr: year < 10 ? '0' + year : '' + year,
		monthStr: month < 10 ? '0' + month : '' + month,
		dayStr: day < 10 ? '0' + day : '' + day,
		hourStr: hour < 10 ? '0' + hour : '' + hour,
		minuteStr: minute < 10 ? '0' + minute : '' + minute,
		secondStr: year < 10 ? '0' + year : '' + year,
	});

	return {
		year,
		month,
		day,
		hour,
		minute,
		second,
		yearStr: year < 10 ? '0' + year : year,
		monthStr: month < 10 ? '0' + month : month,
		dayStr: day < 10 ? '0' + day : day,
		hourStr: hour < 10 ? '0' + hour : hour,
		minuteStr: minute < 10 ? '0' + minute : minute,
		secondStr: year < 10 ? '0' + year : year,
	};
}

export { getDateInfo };
